//
//  Player.m
//  网络FM
//
//  Created by dlios on 15/5/25.
//  Copyright (c) 2015年 dengzhicheng.com. All rights reserved.
//

#import "Player.h"
#import <AudioStreamer.h>


//static AudioStreamer *audioPlayer = nil;

static Player *share = nil;

@implementation Player



+ (Player *)playManager
{
    static dispatch_once_t once;
    dispatch_once(&once, ^{
        if (!share) {
            share = [[Player alloc] init];
        }
    });

    return share;
}

- (void)playWithUrl:(NSString *)url
{
    [self stop];
    self.streamer = [[AudioStreamer alloc] initWithURL:[NSURL URLWithString:url]];
    [self.streamer start];
}

- (void)stop
{
    if (self.streamer) {
        [self.streamer stop];
    }
}


@end
